use ::libc;
extern "C" {
    fn printf(_: *const libc::c_char, _: ...) -> libc::c_int;
    fn putchar(__c: libc::c_int) -> libc::c_int;
}
pub type Category = libc::c_uint;
pub const IPv6Char: Category = 256;
pub const Userinfo: Category = 128;
pub const Fragment: Category = 64;
pub const Query: Category = 64;
pub const HexDigit: Category = 32;
pub const PCharSlash: Category = 16;
pub const SubDelim: Category = 8;
pub const GenDelim: Category = 4;
pub const Unreserved: Category = 2;
pub const Scheme: Category = 1;
#[no_mangle]
pub static mut char_cat: [libc::c_uint; 256] = [0; 256];
#[no_mangle]
pub static mut alnum: *const libc::c_char =
    b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\0" as *const u8
        as *const libc::c_char;
#[no_mangle]
pub static mut unreserved: *const libc::c_char = b"-._~\0" as *const u8 as *const libc::c_char;
#[no_mangle]
pub static mut subdelim: *const libc::c_char = b"!$&'()*+,;=\0" as *const u8 as *const libc::c_char;
#[no_mangle]
pub unsafe extern "C" fn fill(
    mut value: libc::c_uint,
    mut alnum_0: *const libc::c_char,
    mut special: *const libc::c_char,
) {
    while *alnum_0 != 0 {
        char_cat[*alnum_0 as libc::c_uchar as usize] |= value;
        alnum_0 = alnum_0.offset(1);
    }
    while *special != 0 {
        char_cat[*special as libc::c_uchar as usize] |= value;
        special = special.offset(1);
    }
}
#[no_mangle]
pub unsafe extern "C" fn print_table() {
    printf(
        b"// This file is generated by gen_char_category_table. DO NOT EDIT IT BY HAND!\n\nstatic const unsigned short char_cat[256] = {\n//   .0     .1     .2     .3     .4     .5     .6     .7     .8     .9     .A     .B     .C     .D     .E     .F\n\0"
            as *const u8 as *const libc::c_char,
    );
    let mut y: libc::c_uint = 0 as libc::c_int as libc::c_uint;
    while y < 16 as libc::c_int as libc::c_uint {
        putchar(' ' as i32);
        let mut x: libc::c_uint = 0 as libc::c_int as libc::c_uint;
        while x < 16 as libc::c_int as libc::c_uint {
            let offset: libc::c_uint = y
                .wrapping_mul(16 as libc::c_int as libc::c_uint)
                .wrapping_add(x);
            printf(
                b" 0x%03x%c\0" as *const u8 as *const libc::c_char,
                char_cat[offset as usize],
                if offset == 255 as libc::c_int as libc::c_uint {
                    ' ' as i32
                } else {
                    ',' as i32
                },
            );
            x = x.wrapping_add(1);
        }
        printf(
            b" // %01X0 ... %01XF\n\0" as *const u8 as *const libc::c_char,
            y,
            y,
        );
        y = y.wrapping_add(1);
    }
    printf(b"};\n\n\0" as *const u8 as *const libc::c_char);
}
unsafe fn main_0() -> libc::c_int {
    fill(
        Scheme as libc::c_int as libc::c_uint,
        alnum,
        b"+-.\0" as *const u8 as *const libc::c_char,
    );
    fill(Unreserved as libc::c_int as libc::c_uint, alnum, unreserved);
    fill(
        GenDelim as libc::c_int as libc::c_uint,
        alnum,
        b":/?#[]@\0" as *const u8 as *const libc::c_char,
    );
    fill(SubDelim as libc::c_int as libc::c_uint, alnum, subdelim);
    fill(
        PCharSlash as libc::c_int as libc::c_uint,
        alnum,
        b":@/%\0" as *const u8 as *const libc::c_char,
    );
    fill(
        PCharSlash as libc::c_int as libc::c_uint,
        unreserved,
        subdelim,
    );
    fill(
        HexDigit as libc::c_int as libc::c_uint,
        b"0123456789\0" as *const u8 as *const libc::c_char,
        b"abcdefABCDEF\0" as *const u8 as *const libc::c_char,
    );
    fill(
        Query as libc::c_int as libc::c_uint,
        alnum,
        b"/?:@%\0" as *const u8 as *const libc::c_char,
    );
    fill(Query as libc::c_int as libc::c_uint, unreserved, subdelim);
    fill(
        Userinfo as libc::c_int as libc::c_uint,
        alnum,
        b":%\0" as *const u8 as *const libc::c_char,
    );
    fill(
        Userinfo as libc::c_int as libc::c_uint,
        unreserved,
        subdelim,
    );
    fill(
        IPv6Char as libc::c_int as libc::c_uint,
        b"0123456789\0" as *const u8 as *const libc::c_char,
        b"abcdefABCDEF:\0" as *const u8 as *const libc::c_char,
    );
    print_table();
    return 0;
}
pub fn main() {
    unsafe { ::std::process::exit(main_0() as i32) }
}
